package com.jingtai.platform.controller.supply;

import com.jingtai.core.entity.supply.SupplyToMerchantsOrder;
import com.jingtai.platform.service.supply.SupplyToMerchantsOrderService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 供应商向商户发货（商户拿货）订单表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/supplytomerchantsorder")
@Api(tags = "供应商向商户发货（商户拿货）订单表")
public class SupplyToMerchantsOrderController{

    @Autowired
    private SupplyToMerchantsOrderService supplyToMerchantsOrderService;


    @ApiOperation("供应商向商户发货（商户拿货）订单表列表查询")
    @GetMapping("/list")
    public ResultUtil aopSupplyToMerchantsOrderList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return supplyToMerchantsOrderService.SupplyToMerchantsOrderlist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询supplyToMerchantsOrder实体")
    @GetMapping("/getSupplyToMerchantsOrderById")
    public ResultUtil GetSupplyToMerchantsOrderById(@CApiParam(name = "id",value = "supplyToMerchantsOrder实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return supplyToMerchantsOrderService.getSupplyToMerchantsOrderById(id);
    }


    @ApiOperation("新增supplyToMerchantsOrder实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"supplyToMerchantsOrder.id","supplyToMerchantsOrder.createTime","supplyToMerchantsOrder.updateTime","supplyToMerchantsOrder.deleteFlag"})
    public ResultUtil aopAddSupplyToMerchantsOrder(@RequestBody @Validated SupplyToMerchantsOrder supplyToMerchantsOrder){
        return supplyToMerchantsOrderService.addSupplyToMerchantsOrder(supplyToMerchantsOrder);
    }

    @ApiOperation("编辑supplyToMerchantsOrder实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"supplyToMerchantsOrder.createTime","supplyToMerchantsOrder.updateTime","supplyToMerchantsOrder.deleteFlag"})
    public ResultUtil aopEditSupplyToMerchantsOrder(@RequestBody @Validated SupplyToMerchantsOrder supplyToMerchantsOrder){
        return supplyToMerchantsOrderService.editSupplyToMerchantsOrder(supplyToMerchantsOrder);
    }

    @ApiOperation("根据ID删除supplyToMerchantsOrder实体")
    @GetMapping("/delSupplyToMerchantsOrderById")
    public ResultUtil aopDelSupplyToMerchantsOrderById(@CApiParam(name = "id",value = "supplyToMerchantsOrder实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return supplyToMerchantsOrderService.delSupplyToMerchantsOrderById(id);
    }

}






